package com.ahnchan.ContactsPlus;

import com.ahnchan.ContactsPlus.util.WordUtils;

/**
 * Company information
 * 
 * @author Ahnchan
 *
 */
public class Company {

	private String mID;
	private String mContactID;
	private String mName;
	private String mCount;
	private String mMember;
	private String mSearchKey;
	
	
	public String getID() {
		return mID;
	}
	
	public String getContactID() {
		return mContactID;
	}
	
	public String getName() {
		return mName;
	}
	
	public String getCount() {
		return mCount;
	}
	
	public String getMember() {
		return mMember;
	}
	
	public String getSearchKey() {
		return mSearchKey;
	}
	
	public Company(String id, String contactID, String name, int count, String member, String searchKey) {
		mID = id;
		mContactID = contactID;
		mName = name;
		mCount = ""+count;
		mMember = member;
		mSearchKey = searchKey;
	}

	public boolean isThis(String search) {
		
		boolean bResult = false;
		
		if (WordUtils.isInitialSound(mName, search) ||	// English Initial search
   		    WordUtils.isHangulInitialSound(mName, search) ||	// Korean ChoSun search
   			(mName.toUpperCase().indexOf(search.toUpperCase()) >= 0)	// Match string
   			) {
    			
			// Find
			bResult = true;
		}
		
		return bResult;
		
	}
}
